﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class DissolutionCell : MonoBehaviour {

	public long Id;
	public string P_name = "";
	public Sprite head;
	// Use this for initialization
	void Start () {
		
	}

	public void ChangeType(int types){
		
		Sprite texture = null;
		if ( types == 0 ) {
			texture = (Sprite)Resources.Load("image/ZJH/jiesan/X",typeof(Sprite));

		}else{
			texture = (Sprite)Resources.Load("image/ZJH/jiesan/Gou",typeof(Sprite));
		}

		transform.GetChild (2).GetComponent<Image> ().sprite = texture;
		transform.GetChild (2).GetComponent<Image> ().SetNativeSize ();
	}

	public void reset(){
		Sprite texture = (Sprite)Resources.Load("image/ZJH/jiesan/xuan",typeof(Sprite));
		transform.GetChild (2).GetComponent<Image> ().sprite = texture;
		transform.GetChild (2).GetComponent<Image> ().SetNativeSize ();
	}
	
	// Update is called once per frame
	void Update () {
		transform.GetChild (1).GetComponent<Text> ().text = P_name;
		transform.GetChild (0).GetComponent<Image> ().sprite = head;
	}
}
